/**
 * Creating a sidebar enables you to:
 - create an ordered group of docs
 - render a sidebar for each doc of that group
 - provide next/previous navigation

 The sidebars can be generated from the filesystem, or explicitly defined here.

 Create as many sidebars as you want.

 By default, Docusaurus generates a sidebar from the docs folder structure
 */

const componentsCategories = {
  basic: 'Basic',
  navigation: 'Navigation',
  layout: 'Layout',
  controls: 'Controls',
  status: 'Status',
  media: 'Media',
  lists: 'Lists',
  form: 'Form',
  // dateTime: 'Date & Time',
  overlays: 'Overlays',
  charts: 'Charts'
};

module.exports = {
  guidesSidebar: [
    {
      type: 'category',
      label: 'Getting Started',
      collapsible: false,
      items: [
        {
          type: 'autogenerated',
          dirName: `getting-started`
        }
      ]
    }
  ],
  foundationSidebar: [
    {
      type: 'category',
      label: 'Foundation',
      collapsible: false,
      items: [
        {
          type: 'autogenerated',
          dirName: `foundation`
        }
      ]
    }
  ],
  componentsSidebar: [
    {
      type: 'category',
      label: 'Components',
      collapsible: false,
      items: Object.keys(componentsCategories)
        .sort()
        .map(category => {
          return {
            type: 'category',
            label: componentsCategories[category],
            collapsed: true,
            link: {
              type: 'generated-index',
              keywords: [category]
            },
            items: [
              {
                type: 'autogenerated',
                dirName: `components/${category}`
              }
            ]
          };
        })
    },
    {
      type: 'category',
      label: 'Incubator',
      collapsible: false,
      items: [
        {
          type: 'autogenerated',
          dirName: `components/incubator`
        }
      ]
    },
    {
      type: 'category',
      label: 'Infra',
      collapsible: false,
      items: [
        {
          type: 'autogenerated',
          dirName: `components/infra`
        }
      ]
    }
  ]
};
